﻿<div class="wrap-container">
    <form id="admin" class="layui-form" style="width: 90%;padding-top: 20px;">
        <div class="layui-form-item">
            <input type="hidden" name="emaill" value='@ViewData["emaill"]' />
            <label class="layui-form-label">标题：</label>
            <div class="layui-input-block">
                <input type="text" name="Title" required lay-verify="required" autocomplete="off" class="layui-input" value='@ViewData["title"]'>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">内容：</label>
            <div class="layui-input-block">
                <textarea name="Content" placeholder="请输入内容" required lay-verify="required" autocomplete="off" class="layui-textarea"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="formDemo">立即提交</button>
                <button type="reset" onclick="cleartext()" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>

</div>
@section script{
<script>
    //Demo
    layui.use(['form'], function () {
        var form = layui.form();
        form.render();
        //监听提交
        form.on('submit(formDemo)', function (data) {
            //layer.msg(JSON.stringify(data));
            $.ajax({
                type: "post",
                url: "/Home/SendEmaill",
                data: data.field,
                // dataType: 'Json',
                async: true,
                success: function (result) {
                    parent.layer.msg(result);
                }
            });
            return false;
        });
    });
    function cleartext() {
        $("input[name='AdminName']").val("");
        $("input[name='AdminPwd']").val("");
    }
</script>
}

